package com.seadragon.apps.doctorcard.repository;

import java.util.Date;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;

import com.seadragon.apps.doctorcard.model.Chat;
import com.seadragon.apps.doctorcard.model.ChatMessage;

public interface ChatMessageRepository extends JpaRepository<ChatMessage, Long> {
	Page<ChatMessage> findByChatAndDatePublishedAfterOrderByDatePublishedDesc(Chat chat, Date dataLastRetrieved, Pageable pageable);
	
}